export function backBottom(then){
    setTimeout(() => {
        console.log('backBottom',then.$refs.contailer);
        then.$refs.contailer[0].scrollTop  = then.$refs.contailer[0].scrollHeight;
    }, 100);
    
}

export function slectionHistory(tab ,input, type){
    if(type == 'ArrowUp'){
        if(tab.historyCommandPoint <= 0){
            return;
        }
        tab.historyCommandPoint = tab.historyCommandPoint - 1;
        tab.content = (tab.content.substring(0, tab.inputCount) + tab.historyCommand[tab.historyCommandPoint]);
        input.value = tab.content;
        setTimeout(()=>{
            input.selectionStart = tab.content.length;
            input.selectionEnd = tab.content.length;
        },50);
    }else if(type == 'ArrowDown'){
        if(tab.historyCommandPoint >= tab.historyCommand.length-1){
            return;
        }
        tab.historyCommandPoint = tab.historyCommandPoint + 1;
        tab.content = (tab.content.substring(0, tab.inputCount) + tab.historyCommand[tab.historyCommandPoint]);
        input.value = tab.content;
        setTimeout(()=>{
            input.selectionStart = tab.content.length;
            input.selectionEnd = tab.content.length;
        },50);
    }
}